package com.share.wechat.core.controller;

import com.share.wechat.core.entity.QuoteDetail;
import com.share.wechat.core.service.QuoteDetailService;
import org.apache.log4j.Logger;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 核心实体类对于的相关信息的控制类
 * Created by er on 2017/11/17.
 */

@RestController
@RequestMapping("/core/quoteDetail/")
public class QuoteDetailController {
    private final Logger logger = Logger.getLogger(this.getClass());
    @Resource
    private QuoteDetailService quoteDetailService;


    @GetMapping("getByDetailId")
    public QuoteDetail getByDetailId(String detailId) {
        if (StringUtils.isEmpty(detailId)) {
            logger.info("detailId为空 不能查询到相关数据" + detailId);
        }

        QuoteDetail quoteDetail = quoteDetailService.getByDetailId(detailId);

        logger.info("查询到的数据为" + quoteDetail);


        return quoteDetail;
    }


}
